ÿþ--[[ x: WMS-300-21 Tðy: FUÁTagxáOo` Tek \O€: KUN åeg: 2025-1-29 eQãSýQpeÿ Barcode_Sync ŸRý€ô‹f: TekXXû|ß~-N„vFUÁTagx0R WMS „v `Material_Barcode`0 “eQ: FUÁTƋ+Rx Barcode/UPC { { "idcode":"xxx", --Ƌ+Rx (UPC) "inco":"yyy" --FUÁTx (S_ITEM_CODE) } } èla: Nb—„v“eQáOo`O9hncy˜îv„v„v N T € N T ÿïSL‘Å`Œte ØSôf°‹U_: V2.0 HAN 20250401 tetĉƒ V3.0 HAN 20250422 JX_Material_Barcode 9e:N Material_Barcode --]] json = require("json") mobox = require("OILua_JavelinExt") m3 = require( "oi_base_mobox" ) -- eQãSýQpe function Barcode_Sync(strLuaDEID) local nRet, strRetInfo, input_data local inco, idcode -- ·ƒÖS OeQ„vpenc nRet, input_data = m3.GetSysDataJson(strLuaDEID) if (nRet ~= 0) then lua.Stop( strLuaDEID, "àeÕl·ƒÖSpencS: " .. input_data) return end local strCondition local barcode -- YtÏkagpenc for i = 1, #input_data do inco = input_data[i].inco -- FUÁTx idcode = input_data[i].idcode -- Ƌ+Rx if (inco == nil or inco == '') then lua.Stop(strLuaDEID, "FUÁTx Ný€:Nzz!") return end if (idcode == nil or idcode == '') then lua.Stop(strLuaDEID, "Ƌ+Rx Ný€:Nzz!") return end -- ÀhågƋ+Rx/f&Tò]Ï~ù[”^†NvQÖNFUÁTx strCondition = "S_BARCODE = '" .. idcode .. "'" nRet, strRetInfo = mobox.existThisData(strLuaDEID, "Material_Barcode", strCondition) if (nRet ~= 0) then lua.Stop(strLuaDEID, "Œ(u¹eÕlexistThisDataúQ•: " .. strRetInfo) return end if (strRetInfo ~= 'yes') then -- Ƌ+Rx*g«ˆO(u ÿ°ežXFUÁTxŒTƋ+Rx„vÄ~T barcode = m3.AllocObject(strLuaDEID, "Material_Barcode") barcode.item_code = inco -- FUÁTx barcode.barcode = idcode -- Ƌ+Rx nRet, strRetInfo = m3.CreateDataObj(strLuaDEID, barcode) if (nRet ~= 0) then lua.Stop(strLuaDEID, "Œ(u¹eÕlCreateDataObjúQ•: " .. strRetInfo) return end end end -- ԏÞVbŸRáOo` mobox.setInfo(strLuaDEID, "FUÁTagxYtbŸR!") local result = { err_code = 0, err_meg = "bŸR" } mobox.returnValue(strLuaDEID, 1, table2str(result)) end